{extend name="$_theme_public_layout"/}
{block name="style"}
<style type="text/css">

</style>
{/block}

{block name="main"}
<div class="container">
    <div class="content">
        <div class="banner" id="banner">
            <ul class="pic">
                <li>
                    <a href="#">
                        <img src="__THEME_IMG__/banner-1.jpg" alt="">
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="__THEME_IMG__/banner-2.jpg" alt="">
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="__THEME_IMG__/banner-3.jpg" alt="">
                    </a>
                </li>
            </ul>
            <a class="prev" href="javascript:void(0)"><</a>
            <a class="next" href="javascript:void(0)">></a>
            <ul class="hd">
                <li class="on"></li>
                <li></li>
                <li></li>
            </ul>
        </div>

        <div class="recommend">
            <h3>顶置推荐</h3>
            <ul>
                {php}
                    use app\cms\model\Posts as PostsModel;
                    $map['status'] = 1;
                    $map['type'] = 'post';
                    $post_list = PostsModel::where($map)->order('sort desc,create_time desc,id desc')->paginate(5);
                {/php}
                {volist name="post_list" id="data" length="3"}
                    <li>
                        <a href="{:url('cms/index/detail',['id'=>$data['id']])}">
                            <img src="{$data.cover}" alt="{$data.title}">
                            <h4>
                                {$data.title}
                            </h4>
                        </a>
                    </li>
                {/volist}
            </ul>
        </div>

        <div class="new_list">
            <h3>最新文章</h3>
            {volist name="post_list" id="data" length="3"}
                <section class="list">
                    <a href="{:url('cms/index/detail',['id'=>$data['id']])}" class="imgfull">
                        <img src="{$data.cover}" alt="{$data.title}">
                    </a>
                    <h2>
                        <a href="#">
                            {$data.title}
                        </a>
                    </h2>
                    <div class="data">
                        <span class="author">
                            {$data.author_id|get_nickname}
                        </span>
                        <span class="time">
                            {$data.create_time|strtotime|'Y-m-d',|date}
                        </span>
                        <span class="view">
                            {$data.views}
                        </span>
                    </div>
                    <div class="desc">
                        {$data.digest}
                    </div>
                </section>
            {/volist}
        </div>
    </div>



    <aside class="sidebar">
        <div class="side_block">
            <h3>
                热门标签
            </h3>
            <div class="tags">
                {php}
                    use app\cms\model\Tag as TagModel;
                    $tagmap['taxonomy'] = 'post_tag';
                    $tag_list = TagModel::where($tagmap)->select();
                {/php}
                {volist name="tag_list" id="tag"}
                    <a href="{:url('cms/index/index',['tag_id'=>$tag['term_id']])}">
                        {$tag.name}
                    </a>
                {/volist}
            </div>
        </div>

        <div class="side_block">
            <h3>
                热门推荐
            </h3>
            <ul class="hot_list">
                {volist name="post_list" id="data" length="10"}
                    <li>
                        <a href="{:url('cms/index/detail',['id'=>$data['id']])}">
                            {$data.title}
                        </a>
                        <p>
                            {$data.create_time|strtotime|'Y-m-d',|date}
                        </p>
                    </li>
                {/volist}
            </ul>
        </div>
    </aside>

</div>

{/block}

{block name="script"}
<script type="text/javascript">
    $("#banner").slide({
        mainCell:".pic",
        effect:"fold",
        autoPlay:true,
        delayTime:600,
        trigger:"click"
    });
</script>
{/block}
